package longcaisuyun.longcai.com.yiliubabalongcaisuyun;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import java.util.List;

import longcaisuyun.longcai.com.suyunbean.HistoryBean;


/**
 * Created by Administrator on 2016/2/22.
 */
public class HistoryAdapter   extends BaseAdapter {
    ViewHolder   vh;
    Context  context;
    List<HistoryBean> list;
    public  HistoryAdapter(Context context,List<HistoryBean> list){
        this.context=context;
        this.list=list;
    }
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if(convertView==null){
            vh=new ViewHolder();
            convertView=View.inflate(context, R.layout.item_history,null);
            MyApplication.ScaleScreenHelper.loadView((ViewGroup) convertView);
            vh.tv= (TextView) convertView.findViewById(R.id.textView14);
            convertView.setTag(vh);

        }else{
            vh= (ViewHolder) convertView.getTag();
        }
        vh.tv.setText(list.get(position).getTitle());
        return convertView;
    }
    class  ViewHolder{
        public TextView  tv;
    }
}
